/* src/kernel/console/type.h */

#pragma once

#include "../common/type.h"

typedef struct Cursor {//定义光标结构体
    u32 Row, Col; // current Cursor position
} Cursor;

typedef enum ConsoleColor {
    BLACK,
    BLUE,
    GREEN,
    CYAN,
    RED,
    PURPLE,
    YELLOW,
    WHITE,
    GRAY,
    LIGHT_BLUE,
    LIGHT_GREEN,
    LIGHT_CYAN,
    LIGHT_RED,
    LIGHT_PURPLE,
    LIGHT_YELLOW,
    BRIGHT_WHITE
} ConsoleColor;

typedef u32 PhysicalAddress;
// CathodeRayTube Monitor (CRT)
#define MonitorAddressRegister 0x3D4//屏幕地址寄存器 告知你要写哪个寄存器了
#define MonitorDataRegister 0x3D5//告知你把数据给到我，我会帮你写

#define ScreenAddressHigh 0xC
#define ScreenAddressLow 0xD
#define CursorAddressHigh 0xE
#define CursorAddressLow 0xF

#define MonitorBaseAddress 0xB8000
//表示一个屏幕的大小 16KB
#define MonitorSize 0x4000
#define ScreenWidthByte (80 * 2) // 80 chars per line, but 160 bytes per lin
#define ScreenWidth 80
#define ScreenHigh 25
#define ScreenSize (ScreenWidthByte * ScreenHigh)

#define NullChar 0x00
#define BS 0x08 // \b回退
#define HT 0x09 // \t制表
#define LF 0x0A // \n换行
#define CR 0x0D // \r回转符
#define Space 0x20